<template>
  <div id="pageFoot">
    <div class="page_foot_inner">
      <div class="page_foot_nav" :class="{'page_foot_select': select === index}" v-for="(item, index) in routeList" :key="index" @click="footRoute(item.route)">
        <p :class="[select === index ? item.iconfont1 : item.iconfont, select === index ? 'select' : '', 'page_foot_iconfont', 'iconfont']"></p>
        <p :class="[select === index ? 'selectText' : '', 'page_foot_name']" class="">{{ item.name }}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'pageFoot',
  data () {
    return {
      routeList: [
        // 底部信息
        {
          iconfont: 'icon-shouye',
          iconfont1: 'icon-shouye',
          name: '首页',
          route: '/index'
        },
        {
          iconfont: 'icon-tuijian',
          iconfont1: 'icon-tuijian',
          name: '绿茵彩经',
          route: '/recommend'
        },
        {
          iconfont: 'icon-zhuanjiazhuye',
          iconfont1: 'icon-zhuanjiazhuye',
          name: '帮助中心',
          route: '/help'
        },
        {
          iconfont: 'icon-wode',
          iconfont1: 'icon-wode',
          name: '我的',
          route: '/userCenter'
        }
      ]
    };
  },
  methods: {
    footRoute (route) {
      // console.log(route)
      this.$router.push({path: route});
    }
  },
  props: [
    'select'
  ]
};
</script>

<style lang="scss">
  @import '../assets/scss/common_style.scss';
  #pageFoot {
    position: fixed;
    top: 100vh;
    left: 50%;
    width: 750px;
    margin-left: -375px;
    position: absolute;
    z-index: 99;
    .page_foot_inner {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 92px;
      background: #ECECEC;
      .page_foot_nav {
        width: 25%;
        float: left;
        text-align: center;
        color: rgba(70,68,68,1);
        .page_foot_iconfont {
          font-size: 46px;
          line-height: 46px;
          padding-top: 10px;
        }
        .page_foot_name {
          font-size: 20px;
          line-height: 40px;
        }
        &.page_foot_select {
          .page_foot_iconfont {
            color: #FF7A24;
          }
          .page_foot_name {
            color: #FF7A24;
          }
        }
      }
    }
  }
</style>
